home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2005 March
/
Gamestar_71_2005-03_dvd.iso
/
Dema
/
willofsteel_demo.exe
/
{app}
/
Data
/
Shaders
/
Terrain14sf.fx
< prev
next >
Wrap
Text File
|
2004-10-23
|
5KB
|
191 lines
float4x4 WorldViewProjection;
float4x4 ShadowViewProjection;
float4x4 TextureMatrix;
texture AlphaTexture;
texture DiffuseTexture;
texture ShadowTexture;
texture CloudsTexture;
texture FogOfWar;
float3 LightDirection = { 0.0f, 0.0f, 0.0f };
float3 SunColor = { 1., 0.86, .70 };
float3 Ambient = { 0.24, 0.12, 0.04 };
float4 FogScale = { 0.001953125, 0.001953125, 0.001953125, 0.001953125 };
float4 ZBias = { 0.0, 0.0, 0.0, 0.003 };
float4 ShadowOffset;
float4 CloudUVShift = { 0.0, 0.0, 0.0, 0.0 };
float4 CloudScale = { 0.01, 0.01, 0.01, 0.01 };
technique Technique0
{
pass Pass0
{
Texture[0] = (DiffuseTexture);
Texture[1] = (ShadowTexture);
Texture[2] = (FogOfWar);
VertexShaderConstant[0] = <WorldViewProjection>;
VertexShaderConstant[4] = <ShadowViewProjection>;
VertexShaderConstant[8] = <TextureMatrix>;
VertexShaderConstant[27] = <FogScale>;
VertexShaderConstant[30] = <LightDirection>;
VertexShaderConstant[31] = <ZBias>;
VertexShaderConstant[32] = <SunColor>;
VertexShader =
decl
{
stream 0;
float v0[3];
float v3[3];
float v6[2];
}
asm
{
vs_1_1
dcl_position v0
dcl_normal v3
dcl_texcoord0 v6
def c25, 1.0, 1.0, 1.0, 1.0
def c26, 51.2, 0.01953125, 0.0, 0.0
m4x4 oPos, v0, c0
mul r0, v0, c27
mov oT2.x, r0.x
mov oT2.y, r0.z
dp3 r0, v3, c30
mul oD0, r0, c32
mov oT0, v6
dp4 oT1.x, v0, c8
dp4 oT1.y, v0, c9
dp4 r0, v0, c6
add oT3.x, r0, c31.w
};
PixelShaderConstant[17] = <Ambient>;
PixelShader =
asm
{
ps_1_4
def c0, 1, 1, 1, 1
def c1, 0.0, 0.0, 0.0, 0
def c2, 1., 1., 1., 0
def c16, 0.5, 0.065, 25.0, 1.0
def c18, 5., 0.2, 2., 1.0
dcl t0.xy
dcl t1.xy
dcl t2.xy
dcl t3.x
dcl v0.rgba
dcl_2d s0
dcl_2d s1
dcl_2d s2
texld r10, t1, s1
sub r9.r, r10.r, t3.x
mov r1, c1
cmp r10, r9.r, c0, r1
texld r1, t0, s0
mad r0, r10, v0, c17
texld r2, t2, s2
mul r0, r0, r2
mul r0, r0, r1
mov oC0, r0
};
}
}
technique Technique1
{
pass Pass0
{
Texture[0] = (DiffuseTexture);
Texture[1] = (ShadowTexture);
Texture[2] = (FogOfWar);
Texture[3] = (AlphaTexture);
VertexShaderConstant[0] = <WorldViewProjection>;
VertexShaderConstant[4] = <ShadowViewProjection>;
VertexShaderConstant[8] = <TextureMatrix>;
VertexShaderConstant[27] = <FogScale>;
VertexShaderConstant[30] = <LightDirection>;
VertexShaderConstant[31] = <ZBias>;
VertexShaderConstant[32] = <SunColor>;
VertexShader =
decl
{
stream 0;
float v0[3];
float v3[3];
float v6[2];
float v8[2];
}
asm
{
vs_1_1
dcl_position v0
dcl_normal v3
dcl_texcoord0 v6
dcl_texcoord1 v8
mov oT3.y, v0.y
m4x4 oPos, v0, c0
mul r0, v0, c27
mov oT3.x, r0.x
mov oT3.y, r0.z
m4x4 r0, v0, c12
mov oT0, v6
mov oT2, v8
dp4 oT1.x, v0, c8
dp4 oT1.y, v0, c9
dp3 r0, v3, c30
mul oD0, r0, c32
dp4 r0, v0, c6
add oT4.x, r0, c31.w
};
PixelShaderConstant[17] = <Ambient>;
PixelShader =
asm
{
ps_1_4
def c0, 1, 1, 1, 1
def c1, 0.0, 0.0, 0.0, 0
def c2, 1., 1., 1., 0
def c16, 0.5, 0.065, 25.0, 1.0
dcl t0.xy
dcl t1.xy
dcl t2.xy
dcl t3.xy
dcl t4.x
dcl v0.rgba
dcl_2d s0
dcl_2d s1
dcl_2d s2
dcl_2d s3
texld r10, t1, s1
sub r9.r, r10.r, t4.x
mov r1, c1
cmp r10, r9.r, c0, r1
texld r1, t0, s0
mad r0, r10, v0, c17
texld r2, t3, s2
mul r0, r0, r2
mul r0, r0, r1
texld r1, t2, s3
mov r0.a, r1.a
mov oC0, r0
};
}
}